<div id="content">
    <script src="./js/glDatePicker.min.js"></script>

    <script type="text/javascript">
        $(window).load(function()
        {
            $('#mydate').glDatePicker({});
            
        });
    </script>
    <?php
    $IdNews = $_GET['IdNews'];
    $oPDO = new PdoNews();

    $news = $oPDO->readOne($IdNews);

    include("./PDO/PdoAdmin.php"); //On inclut les fonctions PDO (create / update etc...)
    include("./class/Admin.php"); //On inclut les fonctions PDO (create / update etc...)

    $admin = new PdoAdmin();
    $admin = $admin->readAll();

    echo "<form id='formulaire' action='index.php?route=news&action=traitement_modif' method='post'>";
    echo "<table>";
    echo "<tr>";
    echo "<td valign='top'>";
    echo "<label>Titre</label>";
    echo "<input type='text' name='TITRENEWS' value='" . $news->getTitreNews() . "' />";

    echo "<label>Date</label>";
    echo "<input type='text' name='DATENEWS' value='" . $news->getDateNews() . "'  id='mydate'/>";

    echo "<label>Type</label>";
    echo "<input type='text' name='TYPENEWS' value='" . $news->getTypeNews() . "'/>";

    echo "<input type='hidden' name='IDNEWS' value='" . $news->getIdNews() . "' />";
    echo "<label>Auteur</label>";
    echo '<select name="IDADMIN" size="1">';
    foreach ($admin as $unadmin) {
        echo '<option   value="' . $unadmin["IDADMIN"] . '">' . $unadmin["PSEUDOADMIN"] . '</option>';
    }
    echo '</select>' . "<br/>";
    echo "</td>";
    echo "<td align='left'>";
    echo "<label>Contenu</label>";
    echo "<textarea type='text' name='CONTENUNEWS' id='CONTENUNEWS'/>";
    echo $news->getContenuNews();
    echo "</textarea>";
    echo "<br />";
    echo "<input type='submit'  value='Publier'>";
    echo "</td>";
    echo "</table>";
    echo "</form>";

   
    ?></div>